package com.cqut.forum.service;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;

import com.cqut.forum.entity.User;

/**
 * 用户service接口
 * @author yangxun
 */
@Controller
public interface UserService {
	
	/**
	 * 方法检测该用户名是否已经存在
	 * @param userName
	 * @return 如果存在true,否则返回false
	 */
	public User getByName(String userName);
	public User getById(int userId);
	public User login(String userName,String password);
	/**
	 * 用户注册方法
	 * @param user 用户信息
	 * @return 返回注册结果,成功返回true,失败返回false
	 */
	public User register(User user);
	
	public User update(User user);
	
	/**
	 * 用户进入个人主页后加载个人信息
	 * @param user
	 * @return
	 */
	public List<Map<String, Object>> getActiveInfo(User user,boolean isCare,int index,int size);
	public List<Map<String, Object>> getUserInfo(User user,int index,int size);
	
	public Map<String, Object> getUserBasicInfo(User user);
	
	public Map<String,Object> getUserNotice(User user);
	
	public List<Map<String, String>> getVisit(User user);
	
	public List<Map<String, Object>> getFriends(User user);
	
	public List<Map<String, Object>> getMostScore(int index,int size);
	
	public int getUserRank(int userId);
	
	public List<User> fishUser(int index,int size);
	
	public int getUserRoleId(String roleName);
}
